fix: return null instead of false in case of invalid quota#828
fix: return null instead of false in case of invalid quota#828jvillafanez wants to merge 1 commit into
Conversation
|
|
There are some test fails for tests that seem to be better now. The test can be adjusted to expect the now good 200 status. |
|
But the "authentication works when first of multiple configurations has an unreachable host configured" responds with a 500 status. This seems inconsistent to me, and people will complain. |
|
My point was just that the changed code in this PR has (somehow) changed the behavior of that test so that there is a |
dj4oC
left a comment
There was a problem hiding this comment.
Changes UserEntry::getQuota() to return null instead of false for an invalid/unset quota value.
Findings
Stability — potential backward-compat break: this changes the documented return contract from string|false to string|null. Any caller (in this app or in owncloud/core) doing a strict === false (or == false, which would still work) check on the result of getQuota()/wherever this value flows into IUser::setQuota() or similar would silently stop treating "no quota set" as the sentinel it expects. I don't have visibility into all call sites from this diff alone — please confirm no caller relies on === false specifically before merging (a plain grep -rn "getQuota()" across user_ldap + core call sites would settle it).
- The change itself (aligning with PHP's more idiomatic
nullfor "no value") is reasonable and the removedif ($quota === null) { $quota = false; }block is consistent with the new signature.
Test coverage: no test included for the new null-return path.
Verdict
Commenting — low risk, but non-blocking confirmation needed on caller compatibility and a regression test for the null path before merge.
🤖 Automated review by Claude Code (security · stability · performance · coverage)
Generated by Claude Code



Prevent switching to a different server (in a multiple server setup) in case quota isn't set for a particular user.
Related to https://github.com/owncloud/enterprise/issues/7040